package com.yogi.webframework.dto;

import java.io.Serializable;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

import com.yogi.webframework.model.Shop;

public class ShopDto implements Serializable, GenericDto {

	private static final long serialVersionUID = -75926583665414982L;
	
	private Integer id;
	@NotEmpty
	private String shopName;
	@NotEmpty
	private String webUrl;	
	private String phone;
	private String phoneMobile;
	@Email	
	private String email;
	private String contactPerson;
	private String accUsername;
	private String accPassword;
	private String accStatus;
	public ShopDto() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Integer getId() {
		return id;
	}
	public String getShopName() {
		return shopName;
	}
	public String getWebUrl() {
		return webUrl;
	}
	public String getPhone() {
		return phone;
	}
	public String getPhoneMobile() {
		return phoneMobile;
	}
	public String getEmail() {
		return email;
	}
	public String getContactPerson() {
		return contactPerson;
	}
	public String getAccUsername() {
		return accUsername;
	}
	public String getAccPassword() {
		return accPassword;
	}
	public String getAccStatus() {
		return accStatus;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public void setShopName(String shopName) {
		this.shopName = shopName;
	}
	public void setWebUrl(String webUrl) {
		this.webUrl = webUrl;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public void setPhoneMobile(String phoneMobile) {
		this.phoneMobile = phoneMobile;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public void setContactPerson(String contactPerson) {
		this.contactPerson = contactPerson;
	}
	public void setAccUsername(String accUsername) {
		this.accUsername = accUsername;
	}
	public void setAccPassword(String accPassword) {
		this.accPassword = accPassword;
	}
	public void setAccStatus(String accStatus) {
		this.accStatus = accStatus;
	}
	public void constructDto(Object model) {
		if (model instanceof Shop){
			Shop m = (Shop) model;
			if (m.getId() != null){
				setId(m.getId());
			}
			setShopName(m.getShopName());
			setWebUrl(m.getWebUrl());
			setPhone(m.getPhone());
			setPhoneMobile(m.getPhoneMobile());
			setEmail(m.getEmail());
			setContactPerson(m.getContactPerson());
			setAccUsername(m.getAccUsername());
			setAccPassword(m.getAccPassword());
			setAccStatus(m.getAccStatus());
		}
	}
	public void constructModel(Object model) {
		if(model instanceof Shop){
			Shop m = (Shop) model;
			m.setId(getId());
			m.setShopName(getShopName());
			m.setWebUrl(getWebUrl());
			m.setPhone(getPhone());
			m.setPhoneMobile(getPhoneMobile());
			m.setEmail(getEmail());
			m.setContactPerson(getContactPerson());
			m.setAccUsername(getAccUsername());
			m.setAccPassword(getAccPassword());
			m.setAccStatus(getAccStatus());
		}
	}
	
	
	
}
